using System;
using System.Data;
using System.Data.SqlClient;

namespace Net.SamuelChen.Libs.Data.Database {
    public class MsSqlQuery : Query {

        //public MsSqlQuery(string ConnectionString) : base(ConnectionString) { }
        //public void Dispose() {
        //    base.Dispose();
        //}

        protected override IDbConnection CreateConnection() {
            return new SqlConnection();
        }

        protected override IDataAdapter CreateAdapter(IDbCommand selectCommand) {
            return new SqlDataAdapter((SqlCommand)selectCommand);
        }

        public override IDbCommand CreateCommand() {
            return new SqlCommand();
        }

        public override IDataParameter CreateParameter(string parameterName, object value) {
            return new SqlParameter(parameterName, value);
        }

        public override IDataParameter CreateParameter(string parameterName, object value, ParameterDirection direction) {
            IDataParameter parm = new SqlParameter(parameterName, value);
            parm.Direction = direction;
            return parm;
        }
    }
}
